#[[
 * Copyright (c) 2024-2025 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
]]

cmake_minimum_required(VERSION 3.7.2)

add_sources(
    DEP "KernelArchARM"
    PREFIX kernel/arch/arm64/
    CFILES
        context.c
        cpsr.c
        cpu.c
        exception_decode.c
        exception_fun.c
        generic_timers.c
        halt.c
        idle.c
        ipi.c
        pagetable.c
        traps.c
        scr.c
        interrupt_ctrl.c
        psci.c
    ASMFILES
        tools.S
        entry.S
        atomic.S
        exception.S
        smc.S
)

if(DriverGicV2)
add_sources(
    DEP "DriverGicV2"
    CFILES
        kernel/arch/arm64/gic_v2.c
)

endif()

if(DriverGicV3)
add_sources( 
    DEP "DriverGicV3"
    CFILES
        kernel/arch/arm64/gic_v3.c
)
endif()